<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" id="html">

<link href="../pages/style.css" rel="stylesheet" type="text/css">

<head>
	<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
</head>

<title>Handleliste</title>

<body class="body">

<div>
	<div onmouseover="showContent(0)"
		 style="text-align:center; background:lightCyan; font-size:20px; font-weight:bold;  float:left; width:48%; -moz-border-radius-bottomleft:10px;-moz-border-radius-topleft:10px; border:1px solid black; margin:5px;">
		Middag
	</div>
	<div onmouseover="showContent(1)"
		 style="text-align:center;background:lightCyan; font-size:20px; font-weight:bold; float:left; width:48%; -moz-border-radius-bottomright:10px;-moz-border-radius-topright:10px; border:1px solid black; margin:5px;">
		Handleliste
	</div>
</div>

<div id="result"></div>

<div class="footer">Copyright Raymond Koteng</div>

</body>

<script language="JavaScript">
	function showContent(index) {
		element = document.getElementById("result");
		element.innerHTML = (index == 0 ? getMiddag() : getHandleliste());
	}

	function getMiddag() {
		var middagArray = new Array();
		middagArray[0] = new Middag("Kjøttboller med poteter og brun saus");
		middagArray[1] = new Middag("Lettkokt skrei med smørsaus og gulrøtter");
		middagArray[2] = new Middag("Fenalår med vintersalat");
		middagArray[3] = new Middag("Spagetti med kjøttsaus");
		middagArray[4] = new Middag("Lasange");
		middagArray[5] = new Middag("Trenger fler ting");
		middagArray[6] = new Middag("Trenger fler ting");
		middagArray[7] = new Middag("Trenger fler ting");
		middagArray[8] = new Middag("Trenger fler ting");

		var outPut = "<div style='text-align:left; font-size:16px; font-weight:bold;'><ul>";
		for (i = 0; i < middagArray.length; i++) {
			outPut += "<li>" + middagArray[i].navn + "<br/>";

		}

		outPut += "</ul></div>";
		return outPut;
	}

	function getHandleliste() {
		var handlelisteArray = new Array();
		handlelisteArray[0] = new Handleliste("Melk", "4 liter");
		handlelisteArray[1] = new Handleliste("Potet", "5KG");
		handlelisteArray[2] = new Handleliste("Bleier", "3 pakker");
		handlelisteArray[3] = new Handleliste("Egg", "12stk");
		handlelisteArray[4] = new Handleliste("Lasange-pakke", "1");
		handlelisteArray[5] = new Handleliste("Bananer", "ca 2 kg");
		handlelisteArray[6] = new Handleliste("Noe annet", "noe annet");

		var outPut = "<div style='text-align:left; font-size:16px; font-weight:bold;'><ul>";
		for (i = 0; i < handlelisteArray.length; i++) {
			outPut += "<li>" + handlelisteArray[i].navn + " " + handlelisteArray[i].antall + "<br/>";
		}

		outPut += "</ul></div>";
		return outPut;
	}

	function Middag(navn) {
		this.navn = navn;
	}

	function Handleliste(navn, antall) {
		this.navn = navn;
		this.antall = antall;
	}

</script>

</html>